/**
 * Description:
 * Date: 2025-10-26
 * Time: 22:08
 */
public class Test {
    public static void main1(String[] args) {
        int a = 10;              //执行第一句
        System.out.println(a);   //执行第二句
        int b = 20;              //执行第三句
        System.out.println(b);   //执行第四句
        int sum = a + b;         //执行第五句
        System.out.println(sum); //执行第六句
    }

    public static void main2(String[] args) {
        int score = 90;
        if(score >= 90) {
            System.out.println("优秀！");
        }
    }

    public static void main3(String[] args) {
        int score = 60;
        if (score >= 60) {   //满足布尔表达式，结果为true，执行if代码块内容
            System.out.println("及格！");
        } else {
            System.out.println("不及格！");
        }
    }

    public static void main4(String[] args) {
        int score = 60;
        if (score < 60){
            System.out.println("不及格！");
        } else if (score >= 60){
            System.out.println("及格！");
        } else if (score >= 90){
            System.out.println("优秀！");
        } else {
            System.out.println("无成绩！");
        }
    }

    public static void main5(String[] args) {
        int temperatrue = 35;
        if (temperatrue > 0) {
            if (temperatrue < 25) {
                System.out.println("天气适宜!");
            }else {
                System.out.println("天气炎热!");
            }
        }else {
            System.out.println("气温过低，需注意保暖！");
        }
    }

    public static void main6(String[] args) {
        /*switch (表达式) {
            case 常量1:
                //执行语句
                break;
            case 常量2:
                //执行语句
                break;
            case 常量3:
                //执行语句
                break;
            default:
                //执行语句*/
        }

    public static void main7(String[] args) {
        /*long r = 10L;
        switch (r) {
            case 1:
                System.out.println("输出1!");
        }*/

        /*int a = 3;
        switch (a) {
            case "1":
                System.out.println("输出1！");
        }*/

        int day = 6;
        switch (day) {
            case 1:
                System.out.println("星期一");
                break;
            case 2:
                System.out.println("星期二");
                break;
            case 3:
                System.out.println("星期三");
                break;
            case 4:
                System.out.println("星期四");
                break;
            default:
                System.out.println("日期错误！");
        }
    }

    public static void main8(String[] args) {
        int n = 1;
        while (n <= 10) {
            System.out.print(n + " ");
            n++;
        }
        System.out.println();
    }

    public static void main9(String[] args) {
        /*for (初始化语句; 循环条件; 循环变量更新语句) {
            循环体语句
        }*/

        /*for (表达式①;布尔表达式②;表达式③) {
            表达式④
        }*/

        for (int i = 1; i <= 10; i++) {
            System.out.print(i+" ");
        }
    }

    public static void main10(String[] args) {
        /*do {
            //循环语句
        }while (循环条件);*/

        int n = 1;
        do {
            System.out.print(n + " ");
            n++;
        }while (n <= 10);
    }

    public static void main11(String[] args) {
        for (int i = 1; i <= 10; i++) {
            if (i == 5) {
                break;
            }
            System.out.print(i + " ");
        }
        System.out.println();
        System.out.println("for循环之后的第一条语句！");
    }

    public static void main(String[] args) {
        for (int i = 1; i <= 10; i++) {
            if (i == 5) {
                continue;
            }
            System.out.print(i + " ");
        }
        System.out.println();
        System.out.println("for循环之后的第一条语句！");
    }


}
